package com.fyh.entity.common;

import com.alibaba.fastjson.JSON;
import lombok.Data;

import java.util.List;

@Data
public class SendMessage {
    private Boolean isSystem;
    private Long fromId;
    private String type;
    private String Message;
    private List<String> filePathList;

    public SendMessage(Boolean isSystem, Long fromId, String type, String message, List<String> filePathList) {
        this.isSystem = isSystem;
        this.fromId = fromId;
        this.type = type;
        this.Message = message;
    }

    public SendMessage() {
    }

    public static String system(Long fromId, String type, String message, List<String> filePathList) {
        return JSON.toJSONString(new SendMessage(true, fromId, type, message, filePathList));
    }

    public static String user(Long fromId, String type, String message, List<String> filePathList) {
        return JSON.toJSONString(new SendMessage(false, fromId, type, message, filePathList));
    }
}
